$(document).ready(function() {
   
       //$('.dropdown-pane').corner("right 5px");
    //$('#top').corner();    
    // $('.dropdown-pane ').corner(); 
     //  $(".caixa").dropShadow({left: 6, top: 8, opacity: 0.8, blur: 4});
    
        $('form[name="recovery"]').css("opacity","0");        
    
    var aberto = 0;
    var passrecover = 0;
    
       $('#btn_login').click(function() {


    $('form[name="recovery"]').find('.login_inputs').css("display","block"); 
    $('.feedback').css("display","none"); 
    $('.feedback').animate({opacity: 0},400); 
    $('.feedback').html("");
    

   if(aberto == 0)   {     
        
  $('#divlogin').css("display","block");
  $('#divlogin a').css("display","block");
  $('#divlogin').animate({width:"230px"},400);
 // $('#divbuttons').animate({width: 0},400);
  $('#formlogin').css("display","block");
  
  
  
  
  
  aberto = 1;
}

else{
    
    if (passrecover == 1){
       
    $('form[name="recovery"]').css("display","none"); 
    $('form[name="recovery"]').css("opacity","0");        
    $('form[name="login"]').css("display","block"); 
    $('form[name="login"]').animate({opacity: 1},400);     
 
   
    
    passrecover = 0;
      
        
    }
    
    else{

  $('#divlogin').animate({width:"0"},400);
  //$('#divbuttons').animate({width: "100%"},400);
  $('#divlogin a').css("display","none");
  $('#divlogin').css("display","none");
    $('#formlogin').css("display","none");
    aberto=0;    
    
    }
    
    
}

  return false;
});



$('#btnrecovery').click(function() {

    $('form[name="login"]').css("display","none"); 
    $('form[name="login"]').css("opacity","0");
        $('form[name="recovery"]').css("display","block"); 
    $('form[name="recovery"]').animate({opacity: 1},400);  
 
    
    passrecover = 1; 
            
            
  return false;
});


$('#btnok').click(function() {


    
    
     var dataString = 'emailrecovery='+ $('input[name="emailrecovery"]').val();
    $.ajax({
    type: "POST",
    url: "lib/recovery.php",
    data: dataString,
    success: function(msg){
        
    $('form[name="recovery"]').find('.login_inputs').css("display","none"); 
    $('.feedback').css("display","block"); 
    $('.feedback').animate({opacity: 1},400); 
    $('.feedback').html(msg);
},
    error: function(msg){
        
    $('form[name="recovery"]').find('.login_inputs').css("display","none"); 
    $('.feedback').css("display","block"); 
    $('.feedback').animate({opacity: 1},400); 
    $('.feedback').html("Cant connect to our service");
}

})
 
      
  return false;
});

   
   
    
});






